function EditStatusGui(prefix, container, item, options) {
  this._prefix = prefix;
  this._container = container;
  this._item = item;
  
  this._order = (options && options.order) ? options.order : null;
  this._now = (options && options.now) ? options.now : null;
  this._registrar = (options && options.registrar) ? options.registrar : null;
  this._title = (options && options.title) ? options.title : null;
  this._model = (options && options.model) ? options.model : null;
  
  this._createElements();
};

EditStatusGui.prototype._createElements = function() {
  var table, tr, td, input;
  
  var current = null;
  for (var i = 0, il = this._model.states.length; i < il; i++) {
    var state = this._model.states[i];
    if (state.id == this._item.state) {
      current = state;
    }
  }
  
  var actions = [];
  for (var i = 0, il = this._model.transitions.length; i < il; i++) {
    var transition = this._model.transitions[i];
    if (transition.source == this._item.state) {
      actions[actions.length] = transition;
    }
  }
  
  this._container.appendChild(document.createTextNode(this._title));
  
  table = document.createElement('table');
  table.style.width = '350px';
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.width = '240px';
  td.style.textAlign = 'left';
  td.appendChild(document.createTextNode(current.title));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  for (var i = 0, il = this._model.transitions.length; i < il; i++) {
    var transition = this._model.transitions[i];
    if (transition.source.id == this._item.state && transition.validate(this._item, this._order, this._now, this._registrar)) {
      input = DOMUtils.createInput(null, this._prefix + '_' + i, 'button', transition.title, null);
      td.appendChild(input);
    }
  }
  
  if (current.deadline) {
    td = tr.insertCell(-1);
    td.style.textAlign = 'left';
    td.style.padding = '0 0 0 10px';
    td.appendChild(document.createTextNode(current.deadline(this._item, this._now)));
  }
  
  this._container.appendChild(table);
};